app.service("blogService",function($http){
	//查询博客列表
	this.findBlogList = function(page,rows){
		return $http.get("./blog/getBlogList.do?page="+page+"&rows="+rows);
	}
	
	//根据id查询博客详细内容
	this.findBlogById = function(blogId){
		return $http.get("./blog/getBlogById.do?blogId="+blogId);
	}
	
	this.findBlogListByTypeId = function(page,rows,typeId){
		return $http.get("./blog/getBlogListByTypeId.do?typeId="+typeId+"&page="+page+"&rows="+rows);
	}
	//查询，带查询条件
	this.search = function(page,rows,searchEntity){
		return $http.post("./blog/search.do?page="+page+"&rows="+rows,searchEntity);
	}
	
	//删除
	this.del = function(ids){
		return $http.get("./blog/delete.do?ids="+ids);
	}
	
	//保存
	this.save = function(methodName,entity){
		return $http.post("./blog/"+methodName+".do",entity);
	}
	
	//根据id查询
	this.findBlogById = function(blogId){
		return $http.get("./blog/findBlogById.do?blogId="+blogId);
	}
});